package com.wine.exam.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.wine.common.annotation.Excel;
import com.wine.common.core.domain.BaseEntity;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * 对象 exam_paper_answer
 *
 * @author wine
 * @date 2022-12-15
 */
@Getter
@Setter
@EqualsAndHashCode
@AllArgsConstructor
@NoArgsConstructor
@ToString
@TableName("exam_paper_answer")
public class PaperAnswer implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 表主键
     */
    @Excel(name = "表主键")
    @TableId(value = "paper_answer_id", type = IdType.AUTO)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long paperAnswerId;

    /**
     * 试卷id
     */
    @Excel(name = "试卷id")
    @TableField(value = "paper_id")
    @NotBlank(message = "开考试卷不能为空")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long paperId;

    /**
     * 考生开考时间
     */
    @Excel(name = "考生开考时间")
    @TableField(value = "exam_start_time")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long examStartTime;
    /**
     * 试卷该 结束得时间
     */
    @Excel(name = "考生开考时间")
    @TableField(value = "exam_end_time")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long examEndTime;

    /**
     * 耗时
     */
    @Excel(name = "耗时")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(value = "take_time")
    private Long takeTime;

    /**
     * 试卷总分
     */
    @Excel(name = "试卷总分")
    @TableField(value = "total_score")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long totalScore;


    /**
     * 是否正在考试
     */
    @TableField(value = "do_examining")
    private String doExamining;

    /**
     * 考生编号
     */
    @Excel(name = "考生编号")
    @TableField(value = "user_id")
    @JsonSerialize(using = ToStringSerializer.class)
    @NotBlank(message = "考生编号不能为空")
    private Long userId;


    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableLogic
    @TableField(value = "del_flag", select = false)
    private String delFlag;

    /**
     * 创建人
     */

    @TableField(value = "create_by")
    private String createBy;

    /**
     * 创建时间
     */

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;


    /**
     * 更新人
     */

    @TableField(value = "update_by")
    private String updateBy;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

}
